<%@include file="/common/CHeader.jsp" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<!doctype html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

</head>
<body>
<form action="updateColumn" method="post" class="definewidth m20">
    <input type="hidden" name="columnid" value="${olapColumn.columnid}" />
    <table class="table table-bordered table-hover definewidth m10">
        <tr>
            <td width="10%" class="tableleft">表列名称</td>
            <td><input class="form-control" type="text" name="columnname" value="${olapColumn.columnname}"/></td>
        </tr>
        <tr>
            <td class="tableleft">数据字段</td>
            <td><input class="form-control" type="text" name="datafield" value="${olapColumn.datafield}"/></td>
        </tr>
        <tr>
            <td class="tableleft">XML节点</td>
            <td><input class="form-control" type="text" name="nodename" value="${olapColumn.nodename}"/></td>
        </tr>
        <tr>
            <td class="tableleft">数据集ID</td>
            <td><select name="datasetid" id="datasetid" class="form-control">
                <c:forEach items="${olapDatasetList}" var="u">
                    <option value="${u.datasetid}">${u.viewname} ${u.datasetname}</option>
                </c:forEach>
            </select></td>
        </tr>
        <tr>
            <td class="tableleft">是否有效</td>
            <td><select name="active" id="actived" class="form-control">
                <option value="Y">有效</option>
                <option value="N">无效</option>
            </select>
            </td>
        </tr>


        <tr>
            <td class="tableleft"></td>
            <td>
                <input type="submit" class="btn btn-primary" value="保存"></input>	&nbsp;&nbsp;
                <input type="button" class="btn btn-info" name="backid" id="backid" onclick="showlist()" value="返回列表"></input>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
<script>
    $(function () {
        $("#datasetid option").each(function () {
            var idvalue=$(this).val();
            if(idvalue==${olapColumn.datasetid}){
                $(this).attr("selected",true);
            }
        })

    })
</script>
<script>
    $(function () {
        $("#actived option").each(function () {
            var acvalue=$(this).val();
            if(acvalue=="${olapColumn.active}"){
                $(this).attr("selected",true);
            }
        });

    });
    function showlist() {
        window.location.href="<%=basePath %>olapcolumn/selectlist?datasetid=${olapColumn.datasetid}";
    }
</script>
